﻿//using CharacterTest.PersonModel;
using CharacterTest.Decorator;
using CharacterTest.Role;
using System;
using System.Collections.Generic;


namespace CharacterTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");

            var role = new List<Character>
            {
                new King(),
                new Knight(),
                new Queen(),
                new Tolrl()

            };

            //var role1 = new Character();



            Component p = new ConcreteComponent();//创建装饰器
            Component p1 = new ConcreteComponent();
            //foreach (var item in role)
            //{

            Console.WriteLine("-----------------------------");
            Console.WriteLine(role[0].GetType());
            role[0].Display();

            p = new ConcreteDecoratorB(p);//获取装饰器
            p.Operation();
            //Console.WriteLine();
            Console.WriteLine("-----Flight-----");
            role[0].flight();

            //}
            Console.WriteLine();
            Console.WriteLine("-----------------------------");
            Console.WriteLine(role[1].GetType());
            role[1].Display();

            p1 = new ConcreteDecoratorA(p1);//获取装饰器
            p1.Operation();
            //Console.WriteLine();
            Console.WriteLine("-----Flight-----");
            role[1].flight();


            //var ch = new King();
            //Console.WriteLine("--------------");
            //Console.WriteLine(ch.GetType());
            //ch.Display();

            //ch.flight();

        }
    }
}
